﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:Reporter" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  	
	xmlns:controls="clr-namespace:Reporter.Controls"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"  
	mc:Ignorable="d"
    x:Class="Reporter.MainWindow"
	x:Name="Window"
	Title="iBPM Reporter" ResizeMode="CanResizeWithGrip" Width="900" Height="700" WindowState="Maximized" SnapsToDevicePixels="True">
    <Window.Resources>

        <!-- Project TabControl item data templates, ItemContainerStyleSelector and ContentTemplateSelector -->
        <controls:ProjectTabControlContentTemplateSelector x:Key="ProjectTabControlContentTemplateSelector"
                                                 ProjectTemplate="{StaticResource ProjectContentDataTemplate}"
                                                 ProjectHomeTemplate="{StaticResource ProjectHomeContentDataTemplate}"/>

        <controls:ProjectTabItemContainerStyleSelector x:Key="ProjectTabItemContainerStyleSelector" 
                                              ProjectStyle="{StaticResource ProjectTabItem}"
                                              ProjectHomeStyle="{StaticResource ProjectHomeTabItem}"/>

    </Window.Resources>

    <Grid x:Name="LayoutRoot" Background="{DynamicResource ApplicationBackgroundBrush}" DataContext="{Binding Source={StaticResource AppModelDataSource}}" IsHitTestVisible="True">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="34"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="22"/>
            <RowDefinition Height="0.004*"/>
            <RowDefinition Height="0.996*"/>
            <RowDefinition Height="18.05"/>
        </Grid.RowDefinitions>

        <Menu Grid.ColumnSpan="2" Margin="0" Grid.RowSpan="2">
            <MenuItem Header="Project">
                <MenuItem x:Name="AddProject_mi" Header="New..." InputGestureText="Ctrl+N">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding CreateNewProjectCommmand, Mode=OneWay, Source={StaticResource ApplicationManager}}" CommandParameter="{Binding Mode=OneWay}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </MenuItem>
                <MenuItem x:Name="Open_mi" Header="Open...">
                    <MenuItem x:Name="OpenProject_mi" Header="Project" InputGestureText="Ctrl+O">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <i:InvokeCommandAction Command="{Binding OpenProjectCommmand, Mode=OneWay, Source={StaticResource ApplicationManager}}" CommandParameter="{Binding Mode=OneWay}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </MenuItem>
                    <MenuItem x:Name="OpenTeamProject_mi" Header="Team Project" InputGestureText="Ctrl+Schift+O">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <i:InvokeCommandAction Command="{Binding OpenTeamProjectCommmand, Mode=OneWay, Source={StaticResource ApplicationManager}}" CommandParameter="{Binding Mode=OneWay}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </MenuItem>
                </MenuItem>
                <MenuItem x:Name="PublishProject_mi" Header="Publish..." InputGestureText="Ctrl+P">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding PublishProjectCommmand, Mode=OneWay, Source={StaticResource ApplicationManager}}" CommandParameter="{Binding Mode=OneWay}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </MenuItem>
                <MenuItem x:Name="DeleteProject_mi" Header="Delete...">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding DeleteProjectCommmand, Mode=OneWay, Source={StaticResource ApplicationManager}}" CommandParameter="{Binding Mode=OneWay}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </MenuItem>
                <MenuItem x:Name="CloseProject_mi" Header="Close">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding CloseProjectCommand, Mode=OneWay, Source={StaticResource ApplicationManager}}" CommandParameter="{Binding Mode=OneWay}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </MenuItem>
                <MenuItem x:Name="RemoveAllProjects_mi" Header="Close All">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding CloseAllProjectsCommand, Mode=OneWay, Source={StaticResource ApplicationManager}}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </MenuItem>
            </MenuItem>
            <MenuItem Header="Help" VerticalAlignment="Top"/>
        </Menu>
        <Border BorderBrush="Black" BorderThickness="0,1,0,0" Grid.Row="3" Grid.ColumnSpan="2" Background="{DynamicResource PanelBackgroundBrush}" d:LayoutOverrides="GridBox">
            <StackPanel/>
        </Border>
        <Border x:Name="ContentBorder" BorderThickness="1" Grid.Row="2" Grid.ColumnSpan="3" Margin="0,2,0,4">
            <TabControl x:Name="ProjectsTab" ItemsSource="{Binding}" ItemContainerStyleSelector="{StaticResource ProjectTabItemContainerStyleSelector}" Background="#FFF9F9F9" BorderBrush="#FF8C8E94" Style="{DynamicResource ProjectTabControl}" ContentTemplateSelector="{StaticResource ProjectTabControlContentTemplateSelector}" Margin="2.333,-1,-2.333,1" />
        </Border>
        <Rectangle x:Name="dialogPopupBackground" Fill="{DynamicResource ControlDarkOpaqueBrushKey}" Grid.RowSpan="4" Stroke="Black" Grid.ColumnSpan="4" Visibility="Collapsed"/>
    </Grid>
</Window>